package com.anuo.app.study;


import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;

@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration
@ContextConfiguration(locations = {"classpath:spring/spring-context.xml"})

/**
 * 算法研究
  */
public class StudyAlgorithm {

    int count=0;

    /**
     * 递归
     *  参考: https://www.javatpoint.com/recursion-in-java
     */
    @Test
    public void studyRecursion(){
        if (count < 5) { //注意: 如果没有这个条件就是死循环
            System.out.println("hello" + Integer.toString(count));
            count++;
            studyRecursion();
        }
    }
}
